<?php echo breadcrumb(get_breadcrumb($category->id)) ?>

<div class="box">
	<h1 style="background-color:#<?php echo ($category->color)?$category->color:$category->parent->color ?>">
		<img src="uploads/icon/head/<?php echo ($category->image)?$category->image:$category->parent->image ?>" />
		<span><?php echo $category->name ?></span>
		<div class="corner_left"></div>
		<div class="corner_right"></div>
	</h1>
<div class="search">
		<form method="get" >
		<label>คำค้น:</label> <input type="text" name="search" value="<?php echo (!empty($_GET['search']))?$_GET['search']:'' ?>" /> 
		<input type="submit" value="ค้นหา" />
		</form>
	</div>
<div class="detail">
	
	<ul class="list">
		<?php foreach($contents as $content): ?>
		<li>
			<?php if($content->url): ?>
            <a target="_blank" href="<?php echo $content->url ?>">
            <?php else: ?>
			<a href="contents/view/<?php echo $content->id ?>">
			<?php endif; ?>
				<?php echo $content->title ?> <?php echo ($content->file)?icon_file($content->file):'' ?>
			 	- <span><?php echo mysql_to_th(($content->start_date)?$content->start_date:$content->created) ?></span>
			</a>
		</li>
		<?php endforeach; ?>
	</ul>
	<?php echo $contents->pagination()?>
</div>

</div>